(function ($) {

    var dateForm = function (s) {
        return s < 10 ? '0' + s : s
    }
    var date = new Date()
    $('.dateTime .time').text(dateForm(date.getHours()) + ':' + dateForm(date.getMinutes()) + ':' + dateForm( date.getSeconds()))
    window.a ? clearInterval(window.a): ''
    window.a = setInterval(function () {
        var date = new Date()
        $('.dateTime .time').text(dateForm(date.getHours()) + ':' + dateForm(date.getMinutes()) + ':' + dateForm( date.getSeconds()))
    }, 1e3)
    var setDay = function(d) {
        $('.dateTime .day').text(d)
    } 
    var date2 = new Date()
    switch(date2.getDay()) {
        case 1: setDay('星期一');break;
        case 2: setDay('星期二');break;
        case 3: setDay('星期三');break;
        case 4: setDay('星期四');break;
        case 5: setDay('星期五');break;
        case 6: setDay('星期六');break;
        case 7: setDay('星期七');break;
    }
    $('.dateTime .date').text(date2.getFullYear() + '-' + dateForm((date2.getMonth() + 1)) + '-' + dateForm(date2.getDate()))
})(jQuery)